package com.nine.gxh.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.StringSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.util.Date;

/**
 * @author: duonine
 * @date: 2023/7/19
 */
@Data
@TableName("gxh_message")
public class GxhMessage {

    // 防止出现精度丢失，需要将Long类型转为String类型进行返回
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "title")
    private String title;

    @TableField(value = "mtype")
    private String mtype;

    @TableField(value = "content")
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "createdate")
    private Date createdate;

    @TableField(value = "createtime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;

    @TableField(value = "mfrom")
    private String mfrom;

    @TableField(value = "mfromguid")
    private String mfromguid;

    @TableField(value = "mstate")
    private String mstate;
}
